package com.sh.data.engine.application.model.request.normalization;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author : changkong
 * @date : 2022/12/20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IndexDevRequest {
    @Schema(description = "指标开发id", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "指标开发id不能为空")
    private Long id;

    @Schema(description = "开始节点id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long nodeId;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd hh:mm:ss")
    private Date effectiveDateStart;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd hh:mm:ss")
    private Date effectiveDateEnd;

    @Schema(description = "工作流Id")
    private Long taskFlowId;

    private Integer cycle;

    private Integer startTimeHour;

    private Integer startTimeMin;

    private Integer endTimeHour;

    private Integer endTimeMin;

    private String execPoint;

    @Schema(
        description = "周期依赖,0-不依赖上一调度周期 1-等待上一周期结束再运行",
        requiredMode = Schema.RequiredMode.REQUIRED,
        allowableValues = {"0", "1"})
    private Integer cycleDependency;

    /**
     * 指标字段
     */
    private String indexField;

    private String tblName;

    private Long tblId;

    /**
     * 指标开发类型, 0 新建表, 1 已有表开发
     */
    @Schema(description = "指标开发类型")
    @NotNull(message = "指标开发类型不能为空")
    private Integer devType;

    /**
     * 调度类型, 0 定时, 1 依赖调度
     */
    @Schema(description = "触发方式")
    @NotNull(message = "触发方式不能为空")
    private Integer triggerType;

    private Long projectId;
}
